import React, { useEffect } from 'react'
import { Toast } from 'antd-mobile'

import styles from './index.module.css'

function PageLoading() {

    //[]空数组相当于componentDidMount
    useEffect(() => {
        const toast = Toast.show({
            maskClickable: false,
            icon: 'loading',
            duration: 0,
            content: '正在加载...',
        })
        //返回的函数相当于unmountComponentAtNode
        return () => {
            toast.close();
        }
    }, []);

    return (
        <div className={styles.root}>

        </div>
    )
}


export default PageLoading

